/*
 * test-expr.cpp
 *
 *  Created on: 2010-12-18
 *      Author: lyyang
 */

#include "Expr.h"
using namespace std;

int main(int argc, char *argv[])
{
	Expr expr1(5);
	Expr expr2("-", 3);
	Expr expr3("+", 4, 5);
	Expr expr4("*", expr2, expr3);

	expr1.print(cout);
	cout << endl;
	expr2.print(cout);
	cout << endl;
	expr3.print(cout);
	cout << endl;
	expr4.print(cout);
	cout << endl;

	cout << expr1.eval() << endl;
	cout << expr2.eval() << endl;
	cout << expr3.eval() << endl;
	cout << expr4.eval() << endl;

	return 0;
}
